package cn.com.cifi.mars.bean.vo.signPlan;

import cn.com.cifi.mars.util.NumberUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 当年以前签约
 * @author jyx
 * @date 2020/03/19
 */

@Data
@ApiModel(value = "当年以前签约", description = "当年以前签约")
public class PastYearVo {

    @ApiModelProperty(name = "isParking", value = "是否车位楼栋")
    private int isParking;
    @ApiModelProperty(name = "availableNum", value = "<总可售货值>套数/车位数")
    private String availableNum;
    @ApiModelProperty(name = "availableArea", value = "<总可售货值>面积")
    private String availableArea;
    @ApiModelProperty(name = "availableAvgPrice", value = "<总可售货值>均价")
    private String availableAvgPrice;
    @ApiModelProperty(name = "availablePrice", value = "<总可售货值>金额")
    private String availablePrice;

    @ApiModelProperty(name = "signActualNum", value = "<签约实际>套数/车位数")
    private String signActualNum;
    @ApiModelProperty(name = "signActualArea", value = "<签约实际>面积")
    private String signActualArea;
    @ApiModelProperty(name = "signAvgActualPrice", value = "<签约实际>均价")
    private String signAvgActualPrice;
    @ApiModelProperty(name = "signActualPrice", value = "<签约实际>金额")
    private String signActualPrice;

    @ApiModelProperty(name = "signPlanNum", value = "<签约计划>套数/车位数")
    private String signPlanNum;
    @ApiModelProperty(name = "signPlanArea", value = "<签约计划>面积")
    private String signPlanArea;
    @ApiModelProperty(name = "signAvgPlanPrice", value = "<签约计划>均价")
    private String signAvgPlanPrice;
    @ApiModelProperty(name = "signPlanPrice", value = "<签约计划>金额")
    private String signPlanPrice;

    @ApiModelProperty(name = "signFillRate", value = "<签约完成率>%")
    private String signFillRate;
    @ApiModelProperty(name = "actualRemovalRate", value = "<实际去化率>%")
    private String actualRemovalRate;
    @ApiModelProperty(name = "planRemovalRate", value = "<计划去化率>%")
    private String planRemovalRate;

    /**
     * 计算百分率
     */
    public void calculatedPercentage(){
        // 签约完成率(签约实际金额 / 签约计划金额)
        this.signFillRate = NumberUtils.pricePercentage(signActualPrice, signPlanPrice);
        // 实际去化率(签约实际金额 / 总可售货值金额)
        this.actualRemovalRate = NumberUtils.pricePercentage(signActualPrice, availablePrice);
        // 计划去化率（签约计划金额 / 总可售货值金额）
        this.planRemovalRate = NumberUtils.pricePercentage(signPlanPrice, availablePrice);
    }

}
